<template>
  <div id="app">
    <keep-alive>
      <router-view :style="viewStyle"></router-view>
    </keep-alive>
  </div>
</template>

<script>
export default {
  name: "APP",
  data() {
    return {};
  },
  //挂载后执行的操作
  mounted() {
    //不属于移动端设备
    if (window.innerWidth >= 768) {
      //跳转路由
      this.$router.replace({
        path: "/noSupport",
      });
    }
    //属于移动端设备
    else {
      //跳转路由
      this.$router.replace({
        path: "/home",
      });
    }
  },
  computed: {
    //路由页面样式
    viewStyle() {
      const style = {};
      style.width = "100vw";
      style.height = "100vh";
      return style;
    },
  },
};
</script>

<style>
@import "assets/css/base.css";
</style>
